#include <stdio.h>
#include <string.h>
#define WORD_LEN 20
int main(void)
{
    char word[WORD_LEN], smallest_word[WORD_LEN] = "", largest_word[WORD_LEN] = "";
    for(;;) {
        printf("Enter word: ");
        scanf("%s", word);
        if (strlen(word) == 4)
            break;
        if (!*smallest_word || strcmp(word, smallest_word) < 0)
            strcpy(smallest_word, word);
        if (!*largest_word || strcmp(word, largest_word) > 0)
            strcpy(largest_word, word);
    }
    printf("Smallest word: %s\n", smallest_word);
    printf("Largest word: %s\n", largest_word);
    return 0;
}